#include <iostream>
using namespace std;

void primeFactor(long long num) {
	for (int i = 2; i * i <= num; i++) {
		if (num % i == 0) {
			while (num % i == 0) {
				cout << i << " ";
				num /= i;
			}
		}
	}
	if (num != 1) cout << num << " ";
}

int main() {
	long long num;
	cin >> num;
	primeFactor(num);
	return 0;
}
